<?php
	defined('_JEXEC') or die('Restricted access');
	$db =& JFactory::getDBO();
	$q = "SELECT * FROM #__categories WHERE `section` = 'com_contact_details' ORDER BY `ordering` ASC";
	$db->setQuery($q);
	$categories = $db->loadObjectList();	
	$lg = &JFactory::getLanguage();
	$mylang = $lg->get('backwardlang');
?>
<script type="text/javascript">
	$(document).ready(function(){
		$('.contactSessionTitle').css({ 'cursor': 'pointer' }).next().hide().prev().click(function () {
			$('.contactSessionTitle').css({ 'cursor': 'pointer' }).next().hide();
            $(this).next().slideToggle();
        });
		/*$('#canada_bar').css({ 'cursor': 'pointer' }).next().hide().prev().click(function () {
            $(this).next().slideToggle();
            $('#danish_bar,#ireland_bar,#sverige_bar,#finland_bar,#norge_bar').css({ 'cursor': 'pointer' }).next().hide();

        });*/
	});
</script>
<div class="containerUnder">
	<div class="contactLeft">
		<div class="mainTitle"><?php
		if($mylang=="english") {
			echo "Contact";
		} else { 
		echo "Kontakt";
		}
		?></div>
		<div class="contactMap"><iframe width="240" height="394" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Lille+strandstr%C3%A6de+14e,+2.+sal,+1254+K%C3%B8benhavn+K,+Denmark&amp;sll=37.0625,-95.677068&amp;sspn=46.677964,107.138672&amp;vpsrc=0&amp;ie=UTF8&amp;hq=Lille+strandstr%C3%A6de+14e,+2.+sal,+1254&amp;hnear=Copenhagen,+K%C3%B8benhavn+K,+Denmark&amp;t=h&amp;ll=55.680865,12.589773&amp;spn=0.027032,0.051492&amp;output=embed"></iframe></div>
		
		<div class="clr"></div>
	</div>
	<div class="contactRight">
		<div class="contactSession">
			<?php 
				for($i=0;$i<count($categories);$i++){
					?>
					<div class="contactSessionTitle"><?php echo $categories[$i]->title; ?></div>
						<?php 
							$q = "SELECT * FROM #__contact_details WHERE `catid` = ".$categories[$i]->id;
							$db->setQuery($q);
							$contacts = $db->loadObjectList();
						?>
						
						<div>
							<?php
							for($j=0;$j<count($contacts);$j++){
								?>
								<div class="contactSessionItem">
									<div class="contactSessionItemTitle">
										<?php echo $contacts[$j]->name; ?>
									</div>
									<div class="contactSessionItemContent">
										<?php if($contacts[$j]->address!= "") { echo $contacts[$j]->address."<br/>"; } ?>
										<?php if($contacts[$j]->telephone!= "") { echo "Tlf.:".$contacts[$j]->telephone."<br/>"; } ?>
										<?php if($contacts[$j]->fax!= "") { echo "Fax:".$contacts[$j]->fax."<br/>"; } ?>
										<?php if($contacts[$j]->email_to!= "") { echo "<a class='press_link' href='mailto:".$contacts[$j]->email_to."'>".$contacts[$j]->email_to."</a><br/>"; } ?>
										<?php if($contacts[$j]->misc!= "") { echo "Cvr:".$contacts[$j]->misc."<br/>"; } ?>
									</div>
								</div>
								<?php
							}			
							?>
						</div>
					<?
				}
			?>
			<div class="contactLine"></div>
		</div>
	</div>

	<div class="clr"></div>
	</div>